//
//  SecondVCOfNavi.m
//  UI09_UITabBarController
//
//  Created by LGC on 16/3/21.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "SecondVCOfNavi.h"

@interface SecondVCOfNavi ()
@property (nonatomic, retain) UIButton *button;
@end

@implementation SecondVCOfNavi

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self createButton];
    // Do any additional setup after loading the view.
}

#pragma mark - 创建一个button, 用来挑战到第二个Item.
- (void)createButton {
    self.button = [UIButton buttonWithType:UIButtonTypeSystem];
    self.button.frame = CGRectMake(0, 0, 100, 100);
    self.button.center = self.view.center;
    self.button.backgroundColor = [UIColor blueColor];
    [self.button setTitle:@"点击" forState:UIControlStateNormal];
    [self.button addTarget:self action:@selector(handleRead:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.button];
    
}

/** 跳到第二个Item */
- (void)handleRead:(UIButton *)button {
    self.navigationController.tabBarController.selectedIndex = 1;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
